package UILayer;

import java.util.Scanner;

public class UI {
	/**
	 * Fields for the different kinds of UI*/
	private KundeUI kundeUI;
	private SalgUI salgUI;
	private VareUI vareUI;
	
	/**
	 * Constructor for the salgUI*/
	public UI()
	{
		kundeUI = new KundeUI();
		salgUI = new SalgUI();
		vareUI = new VareUI();
	}
	/**
	 * Start the UI
	 * Ask for input and goto the chosen UI.
	 * */
	public void startUI()
	{
		boolean start = false;
		while(!start){
			Scanner input = new Scanner(System.in);
			System.out.println("1. Kunde UI");
			System.out.println("2. Salg UI");
			System.out.println("3. Vare UI");
			System.out.println("Other characthers will close the program.");
			int choice = input.nextInt();
		
			switch(choice){
			case 1:
				try{
					kundeUI.startKundeUI();
				}catch(Exception e){
					System.out.println("Cant create KundeUI");
				}
				break;
			case 2:
				try{
					salgUI.startSalgUI();
				}catch(Exception e){
					System.out.println("Cant create SalgUI");
				}
				break;
			case 3:
				try{
					vareUI.startVareUI();
				}catch(Exception e){
					System.out.println("Cant create VareUI");
				}
				break;
			default:
				System.out.println("Closing down");
				start = true;
				break;
			}
		}
	}
	/**
	 * Main method to start it all!
	 * */
	
}
